package com.example.event_resource_java.authority.domain.resourceLibrary;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.example.event_resource_java.authority.dao.EventResourceAllocationDO;
import com.example.event_resource_java.authority.domain.share.PageInfo;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;
import java.util.Map;

/**
 * (SecretKey)实体类
 *
 * @author makejava
 * @since 2024-05-09 10:28:41
 */
@Data
@TableName("secret_key")
public class SecretKey extends PageInfo implements Serializable {
    private static final long serialVersionUID = 700965976036685138L;

    @TableId
    private Long id;

    @ApiModelProperty(value = "秘钥")
    @TableField(value = "secret_key")
    private String secretKey;

    @ApiModelProperty(value = "单位名称")
    @TableField(value = "unit_name")
    private String unitName;

    @ApiModelProperty(value = "备注")
    @TableField(value = "remark")
    private String remark;

    @ApiModelProperty(value = "0 = 永久 1 = 时间限定")
    @TableField(value = "type")
    private Integer type;

    @ApiModelProperty(value = "0 = 使用中/启用  1 = 禁用  2 = 过期")
    @TableField(value = "status")
    private Integer status;

    @ApiModelProperty(value = "逻辑删除，默认为0")
    @TableField(value = "is_deleted")
    private Integer isDeleted;

    @ApiModelProperty(value = "创建人id")
    @TableField(value = "creater_id")
    private Long createrId;

    @ApiModelProperty(value = "修改人id")
    @TableField(value = "updater_id")
    private Long updaterId;

    @ApiModelProperty(value = "创建时间")
    @TableField(value = "creater_date")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", shape = JsonFormat.Shape.STRING)
    private LocalDateTime createrDate;

    @ApiModelProperty(value = "创建时间")
    @TableField(value = "update_date")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", shape = JsonFormat.Shape.STRING)
    private LocalDateTime updateDate;

    @ApiModelProperty(value = "使用人id")
    @TableField(value = "user_id")
    private Long userId;

    @ApiModelProperty(value = "使用人姓名")
    @TableField(exist = false)
    private String userName;

    @ApiModelProperty(value = "到期时间")
    @TableField(value = "expiration_date")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", shape = JsonFormat.Shape.STRING)
    private LocalDateTime expirationDate;

    @ApiModelProperty(value = "资源集合")
    @TableField(exist = false)
    private List<SecretAssets> secretAssets;

    @ApiModelProperty(value = "资源信息")
    @TableField(exist = false)
    private Map<String,List<EventResourceAllocationDO>> eventrMap;

}

